<!DOCTYPE html>
<html lang=zh>
<head>
    <meta charset="utf-8">
    
    <title>Oracle监听多台主机配置，用plsql连接操作多个数据库详解 | 胡先森的博客</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
    <meta name="description" content="很多朋友在开发项目中并不是每个人用一个数据库，而是有单独的一台主机作为开发的数据库服务器，这样，就需要我们的开发人员去连接他。

虽然网上有很多关于无需安装oracle客户端，只需要进行特殊的配置即可能够对数据库进行操作，这里就不多说了，网上有很多关于这样的博文，我这里要说的是在已安装好oracle客户端的机器上监听其他的数据库；">
<meta property="og:type" content="article">
<meta property="og:title" content="Oracle监听多台主机配置，用plsql连接操作多个数据库详解">
<meta property="og:url" content="http://yunzhi.oschina.io/2017/10/16/oracle/index.html">
<meta property="og:site_name" content="胡先森的博客">
<meta property="og:description" content="很多朋友在开发项目中并不是每个人用一个数据库，而是有单独的一台主机作为开发的数据库服务器，这样，就需要我们的开发人员去连接他。

虽然网上有很多关于无需安装oracle客户端，只需要进行特殊的配置即可能够对数据库进行操作，这里就不多说了，网上有很多关于这样的博文，我这里要说的是在已安装好oracle客户端的机器上监听其他的数据库；">
<meta property="og:image" content="http://static.oschina.net/uploads/space/2012/1218/214009_sde7_583593.png">
<meta property="og:image" content="http://static.oschina.net/uploads/space/2012/1218/214020_NaHf_583593.png">
<meta property="og:image" content="http://static.oschina.net/uploads/space/2012/1218/214037_CfFZ_583593.png">
<meta property="og:image" content="http://static.oschina.net/uploads/space/2012/1218/214049_BJHl_583593.png">
<meta property="og:image" content="http://static.oschina.net/uploads/space/2012/1218/214103_S0VC_583593.png">
<meta property="og:image" content="http://static.oschina.net/uploads/space/2012/1218/214113_kyl4_583593.png">
<meta property="og:image" content="http://static.oschina.net/uploads/space/2012/1218/214124_XPGm_583593.png">
<meta property="og:image" content="http://static.oschina.net/uploads/space/2012/1218/214153_u97T_583593.png">
<meta property="og:updated_time" content="2017-10-22T09:42:06.675Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="Oracle监听多台主机配置，用plsql连接操作多个数据库详解">
<meta name="twitter:description" content="很多朋友在开发项目中并不是每个人用一个数据库，而是有单独的一台主机作为开发的数据库服务器，这样，就需要我们的开发人员去连接他。

虽然网上有很多关于无需安装oracle客户端，只需要进行特殊的配置即可能够对数据库进行操作，这里就不多说了，网上有很多关于这样的博文，我这里要说的是在已安装好oracle客户端的机器上监听其他的数据库；">
<meta name="twitter:image" content="http://static.oschina.net/uploads/space/2012/1218/214009_sde7_583593.png">
    

    

    

    <link rel="stylesheet" href="/libs/font-awesome/css/font-awesome.min.css">
    <link rel="stylesheet" href="/libs/open-sans/styles.css">
    <link rel="stylesheet" href="/libs/source-code-pro/styles.css">

    <link rel="stylesheet" href="/css/style.css">

    <script src="/libs/jquery/2.1.3/jquery.min.js"></script>
    
    
        <link rel="stylesheet" href="/libs/lightgallery/css/lightgallery.min.css">
    
    
        <link rel="stylesheet" href="/libs/justified-gallery/justifiedGallery.min.css">
    
    
    
    
        <script>
var _hmt = _hmt || [];
(function() {
    var hm = document.createElement("script");
    hm.src = "//hm.baidu.com/hm.js?1eb097f6aa00c09fc53fbc426f6c061c";
    var s = document.getElementsByTagName("script")[0];
    s.parentNode.insertBefore(hm, s);
})();
</script>

    


</head>

<body>
    <div id="container">
        <header id="header">
    <div id="header-main" class="header-inner">
        <div class="outer">
            <a href="/" id="logo">
                <i class="logo"></i>
                <span class="site-title">胡先森的博客</span>
            </a>
            <nav id="main-nav">
                
                    <a class="main-nav-link" href="/.">主页</a>
                
                    <a class="main-nav-link" href="/archives">归档</a>
                
                    <a class="main-nav-link" href="/categories">分类</a>
                
                    <a class="main-nav-link" href="/tags">标签</a>
                
                    <a class="main-nav-link" href="/about">关于</a>
                
            </nav>
            
                
                <nav id="sub-nav">
                    <div class="profile" id="profile-nav">
                        <a id="profile-anchor" href="javascript:;">
                            <img class="avatar" src="/css/images/img.jpg" />
                            <i class="fa fa-caret-down"></i>
                        </a>
                    </div>
                </nav>
            
            <div id="search-form-wrap">

    <form class="search-form" method="GET" action="https://www.baidu.com/s?">
    <input name="wd" type="text" class="search-form-input" placeholder="搜索" />
    <button type="submit" class="search-form-submit"></button>
</form>
<script>
(function ($) {
    $('.search-form').on('submit', function (e) {
        var keyword = $('.search-form-input[name="wd"]').val();
        window.location = 'https://www.baidu.com/s?wd=site:yunzhi.oschina.io ' + keyword;
        return false;
    });
})(jQuery);
</script>

</div>
        </div>
    </div>
    <div id="main-nav-mobile" class="header-sub header-inner">
        <table class="menu outer">
            <tr>
                
                    <td><a class="main-nav-link" href="/.">主页</a></td>
                
                    <td><a class="main-nav-link" href="/archives">归档</a></td>
                
                    <td><a class="main-nav-link" href="/categories">分类</a></td>
                
                    <td><a class="main-nav-link" href="/tags">标签</a></td>
                
                    <td><a class="main-nav-link" href="/about">关于</a></td>
                
                <td>
                    
    <form class="search-form" method="GET" action="https://www.baidu.com/s?">
    <input name="wd" type="text" class="search-form-input" placeholder="搜索" />
    <button type="submit" class="search-form-submit"></button>
</form>
<script>
(function ($) {
    $('.search-form').on('submit', function (e) {
        var keyword = $('.search-form-input[name="wd"]').val();
        window.location = 'https://www.baidu.com/s?wd=site:yunzhi.oschina.io ' + keyword;
        return false;
    });
})(jQuery);
</script>

                </td>
            </tr>
        </table>
    </div>
</header>

        <div class="outer">
            
                

<aside id="profile">
    <div class="inner profile-inner">
        <div class="base-info profile-block">
            <img id="avatar" src="/css/images/img.jpg" />
            <h2 id="name">胡先森</h2>
            <h3 id="title">Java Developer &amp; Web Developer &amp; PHP</h3>
            <span id="location"><i class="fa fa-map-marker"></i>ChangSha, China</span>
            <a id="follow" target="_blank" href="http://git.oschina.net/yunzhi">关注我</a>
        </div>
        <div class="article-info profile-block">
            <div class="article-info-block">
                2
                <span>文章</span>
            </div>
            <div class="article-info-block">
                1
                <span>标签</span>
            </div>
        </div>
        
        <div class="profile-block social-links">
            <table>
                <tr>
                    
                    
                    <td>
                        <a href="http://git.oschina.net/yunzhi" target="_blank" title="github" class=tooltip>
                            <i class="fa fa-github"></i>
                        </a>
                    </td>
                    
                </tr>
            </table>
        </div>
        
    </div>
</aside>

            
            <section id="main"><article id="post-oracle" class="article article-type-post" itemscope itemprop="blogPost">
    <div class="article-inner">
        
        
            <header class="article-header">
                
    
        <h1 class="article-title" itemprop="name">
            Oracle监听多台主机配置，用plsql连接操作多个数据库详解
        </h1>
    

                
                    <div class="article-meta">
                        
    <div class="article-date">
        <i class="fa fa-calendar"></i>
        <a href="/2017/10/16/oracle/">
            <time datetime="2017-10-16T12:18:15.000Z" itemprop="datePublished">2017-10-16</time>
        </a>
    </div>


                        
    <div class="article-category">
    	<i class="fa fa-folder"></i>
        <a class="article-category-link" href="/categories/数据库/">数据库</a>
    </div>

                        
    <div class="article-tag">
        <i class="fa fa-tag"></i>
        <a class="tag-link" href="/tags/oracle/">oracle</a>
    </div>

                    </div>
                
            </header>
        
        
        <div class="article-entry" itemprop="articleBody">
        
            
            <blockquote>
<p>很多朋友在开发项目中并不是每个人用一个数据库，而是有单独的一台主机作为开发的数据库服务器，这样，就需要我们的开发人员去连接他。</p>
</blockquote>
<p>虽然网上有很多关于无需安装oracle客户端，只需要进行特殊的配置即可能够对数据库进行操作，这里就不多说了，网上有很多关于这样的博文，我这里要说的是在已安装好oracle客户端的机器上监听其他的数据库；<br><a id="more"></a></p>
<blockquote>
<p>1.首先是进入oracle的 Net  Mananger；</p>
</blockquote>
<p><img src="http://static.oschina.net/uploads/space/2012/1218/214009_sde7_583593.png" alt="image"></p>
<blockquote>
<p>2.接下来就是进行简单的设置了。。<br>点击此处的“+”号</p>
</blockquote>
<p><img src="http://static.oschina.net/uploads/space/2012/1218/214020_NaHf_583593.png" alt="image"></p>
<blockquote>
<p>3.进入到如下界面，当中的服务名可以自己定义，我这里的是“service”。代表连接数据库服务器，而非本机：</p>
</blockquote>
<p><img src="http://static.oschina.net/uploads/space/2012/1218/214037_CfFZ_583593.png" alt="image"></p>
<p>点下一步，选择tcp/ip协议，再进入到下一步，将要监听的目标主机的IP地址输入进去，接着走下一步，在下面这步要注意了，</p>
<p>这里是要输入目标主机的数据库实例，需要查看目标主机的实例名，要对应才能监听，我这里是默认的orcl。点下一步完成，也可以先测试是否能连上</p>
<p><img src="http://static.oschina.net/uploads/space/2012/1218/214049_BJHl_583593.png" alt="image"></p>
<blockquote>
<p>4.完成之后，就可以在“服务命名”下面看得到刚刚添加的服务</p>
</blockquote>
<p><img src="http://static.oschina.net/uploads/space/2012/1218/214103_S0VC_583593.png" alt="image"></p>
<p>点击可以查看到详细信息，这里需要把连接类型改为“专用服务器”才能连接上目标数据库（一定要注意）：</p>
<p><img src="http://static.oschina.net/uploads/space/2012/1218/214113_kyl4_583593.png" alt="image"></p>
<p>确认无误后就可以设置监听了，这里我需要说两句，网上有关信息是在原有的监听程序里面添加一个目标ip监听，但是照做之后根本无法监听，甚至是监听服务都无法启动，虽然不知道是我配置错误还是别人讲解有误，这里就不加评论了。 </p>
<p>步入正题。。。。。同样在“监听程序”下添加监听； </p>
<p>监听程序名可以自己随意命名，确定之后会需要自己添加目标地址，在如下图所示进行添加即可； </p>
<p><img src="http://static.oschina.net/uploads/space/2012/1218/214124_XPGm_583593.png" alt="image"></p>
<p>好了，以上这就是简单的监听配置，点“文件”保存网络配置，把所有oracle 的服务重新启动就OK了。 </p>
<p>接下来我们用pl/sql工具连接目标主机数据库，在这里我们可以看到刚刚配置的一个服务，如下图： </p>
<p><img src="http://static.oschina.net/uploads/space/2012/1218/214153_u97T_583593.png" alt="image"></p>
<blockquote>
<p>这样就可以通过工具来对目标数据库进行操作了。。。 如果是想监听多个目标数据库，重复以上的步骤就可以了！</p>
</blockquote>

        
        </div>
        <footer class="article-footer">
            <div class="share-container">


    <div class="bdsharebuttonbox">
    <a href="#" class="bds_more" data-cmd="more">分享到：</a>
    <a href="#" class="bds_qzone" data-cmd="qzone" title="分享到QQ空间">QQ空间</a>
    <a href="#" class="bds_tsina" data-cmd="tsina" title="分享到新浪微博">新浪微博</a>
    <a href="#" class="bds_tqq" data-cmd="tqq" title="分享到腾讯微博">腾讯微博</a>
    <a href="#" class="bds_renren" data-cmd="renren" title="分享到人人网">人人网</a>
    <a href="#" class="bds_weixin" data-cmd="weixin" title="分享到微信">微信</a>
</div>
<script>
window._bd_share_config={"common":{"bdSnsKey":{},"bdText":"","bdMini":"2","bdMiniList":false,"bdPic":"","bdStyle":"0","bdSize":"16"},"share":{"bdSize":16}};with(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('script')).src='http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion='+~(-new Date()/36e5)];
</script>
<style>
    .bdshare_popup_box {
        border-radius: 4px;
        border: #e1e1e1 solid 1px;
    }
    .bdshare-button-style0-16 a,
    .bdshare-button-style0-16 .bds_more {
        padding-left: 20px;
        margin: 6px 10px 6px 0;
    }
    .bdshare_dialog_list a,
    .bdshare_popup_list a,
    .bdshare_popup_bottom a {
        font-family: 'Microsoft Yahei';
    }
    .bdshare_popup_top {
        display: none;
    }
    .bdshare_popup_bottom {
        height: auto;
        padding: 5px;
    }
</style>


</div>

            
    
        <a href="http://yunzhi.oschina.io/2017/10/16/oracle/#comments" class="article-comment-link">评论</a>
    

        </footer>
    </div>
    
        
<nav id="article-nav">
    
    
        <a href="/2017/03/25/first/" id="article-nav-older" class="article-nav-link-wrap">
            <strong class="article-nav-caption">下一篇</strong>
            <div class="article-nav-title">写在前面</div>
        </a>
    
</nav>


    
</article>


    
    <section id="comments">
    
        
    <div id="uyan_frame"></div>

    
    </section>

</section>
            
                <aside id="sidebar">
   
        
    <div class="widget-wrap">
        <h3 class="widget-title">最新文章</h3>
        <div class="widget">
            <ul id="recent-post" class="">
                
                    <li>
                        
                        <div class="item-thumbnail">
                            <a href="/2017/10/16/oracle/" class="thumbnail">
    
    
        <span class="thumbnail-image thumbnail-none"></span>
    
</a>

                        </div>
                        
                        <div class="item-inner">
                            <p class="item-category"><a class="article-category-link" href="/categories/数据库/">数据库</a></p>
                            <p class="item-title"><a href="/2017/10/16/oracle/" class="title">Oracle监听多台主机配置，用plsql连接操作多个数据库详解</a></p>
                            <p class="item-date"><time datetime="2017-10-16T12:18:15.000Z" itemprop="datePublished">2017-10-16</time></p>
                        </div>
                    </li>
                
                    <li>
                        
                        <div class="item-thumbnail">
                            <a href="/2017/03/25/first/" class="thumbnail">
    
    
        <span class="thumbnail-image thumbnail-none"></span>
    
</a>

                        </div>
                        
                        <div class="item-inner">
                            <p class="item-category"></p>
                            <p class="item-title"><a href="/2017/03/25/first/" class="title">写在前面</a></p>
                            <p class="item-date"><time datetime="2017-03-25T04:00:15.000Z" itemprop="datePublished">2017-03-25</time></p>
                        </div>
                    </li>
                
            </ul>
        </div>
    </div>

    
        
    <div class="widget-wrap">
        <h3 class="widget-title">分类</h3>
        <div class="widget">
            <ul class="category-list"><li class="category-list-item"><a class="category-list-link" href="/categories/数据库/">数据库</a><span class="category-list-count">1</span></li></ul>
        </div>
    </div>

    
        
    <div class="widget-wrap">
        <h3 class="widget-title">归档</h3>
        <div class="widget">
            <ul class="archive-list"><li class="archive-list-item"><a class="archive-list-link" href="/archives/2017/10/">十月 2017</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2017/03/">三月 2017</a><span class="archive-list-count">1</span></li></ul>
        </div>
    </div>

    
        
    <div class="widget-wrap">
        <h3 class="widget-title">标签</h3>
        <div class="widget">
            <ul class="tag-list"><li class="tag-list-item"><a class="tag-list-link" href="/tags/oracle/">oracle</a><span class="tag-list-count">1</span></li></ul>
        </div>
    </div>

    
        
    <div class="widget-wrap">
        <h3 class="widget-title">标签云</h3>
        <div class="widget tagcloud">
            <a href="/tags/oracle/" style="font-size: 10px;">oracle</a>
        </div>
    </div>

    
        
    <div class="widget-wrap widget-list">
        <h3 class="widget-title">链接</h3>
        <div class="widget">
            <ul>
                
                    <li>
                        <a href="http://hexo.io">Hexo</a>
                    </li>
                
            </ul>
        </div>
    </div>


    
    <div id="toTop" class="fa fa-angle-up"></div>
</aside>
            
        </div>
        <footer id="footer">
    <div class="outer">
        <div id="footer-info" class="inner">
            &copy; 2017 胡先森<br>
            Powered by <a href="http://hexo.io/" target="_blank">Hexo</a>. Theme by <a href="http://github.com/ppoffice">PPOffice</a>
        </div>
    </div>
</footer>
        
    
    <script type="text/javascript" src="http://v2.uyan.cc/code/uyan.js?uid=2128592"></script>



    
        <script src="/libs/lightgallery/js/lightgallery.min.js"></script>
        <script src="/libs/lightgallery/js/lg-thumbnail.min.js"></script>
        <script src="/libs/lightgallery/js/lg-pager.min.js"></script>
        <script src="/libs/lightgallery/js/lg-autoplay.min.js"></script>
        <script src="/libs/lightgallery/js/lg-fullscreen.min.js"></script>
        <script src="/libs/lightgallery/js/lg-zoom.min.js"></script>
        <script src="/libs/lightgallery/js/lg-hash.min.js"></script>
        <script src="/libs/lightgallery/js/lg-share.min.js"></script>
        <script src="/libs/lightgallery/js/lg-video.min.js"></script>
    
    
        <script src="/libs/justified-gallery/jquery.justifiedGallery.min.js"></script>
    



<!-- Custom Scripts -->
<script src="/js/main.js"></script>

    </div>
</body>
</html>